package com.xoa.controller.equipment;


import com.xoa.model.equipment.LimsEquipInvePlan;
import com.xoa.service.equipment.EquipmentInventoryService;
import com.xoa.util.LimsJson;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;

@Controller
@RequestMapping("equipInventory")
public class EquipmentInventoryController {

    /**
     *
     * @作者 庞君
     * @创建日期 11:21 2019/10/21 0021
     * @类介绍 设备盘点页面主页映射
     *
     */
    @RequestMapping("inventIndex")
    public String inventIndex(){
        return "/app/equipment/equipmentInventory/inventoryIndex";
    }
    /**
     *
     * @作者 庞君
     * @创建日期 11:23 2019/10/21 0021
     * @类介绍 添加设备盘点信息
     *
     */
    @RequestMapping("addInventory")
    public String addInventory(){
        return "/app/equipment/equipmentInventory/addInventory";
    }

    @RequestMapping("editInventory")
    public  String editInventory(){
        return "/app/equipment/equipmentInventory/editInventory";
    }

    @Autowired
    private EquipmentInventoryService equipmentInventoryService;
    /*
    * 创建作者:   庞君
    * 创建日期:   16:41 2019/10/21
    * 方法介绍:   添加盘点计划
    * 参数说明:   No such property: code for class: Script1
    * @return     com.xoa.util.lims.LimsJson
    */
    @RequestMapping("addInvenPlan")
    @ResponseBody
    public LimsJson addInvenPlan(String  limsEquipInvePlan , String limsEquipInveCont, String equips){
        return equipmentInventoryService.addInvenPlan(limsEquipInvePlan,limsEquipInveCont,equips);
    }

    /**
    * 创建作者:   庞君
    * 创建日期:   17:06 2019/10/21
    * 方法介绍:   查询当前登录人盘点列表
    * 参数说明:   No such property: code for class: Script1
    * @return     com.xoa.util.lims.LimsJson
    */
    @ResponseBody
    @RequestMapping("InvenPlanList")
    public LimsJson InvenPlanList(HttpServletRequest request,Integer page,Integer limit){
        return  equipmentInventoryService.InvenPlanList(request,page,limit);
    }
    /**
    * 创建作者:   庞君
    * 创建日期:   8:47 2019/10/22
    * 方法介绍:   根据inveId查询设备明细
    * 参数说明:   No such property: code for class: Script1
    * @return
    */
    @ResponseBody
    @RequestMapping("findEquipByInveId")
    public LimsJson findEquipByInveId(HttpServletRequest request,Integer page,Integer limit,Integer inveId){
        return equipmentInventoryService.findEquipByInveId(request,page,limit,inveId);
    }
    /**
    * 创建作者:   庞君
    * 创建日期:   8:59 2019/10/22
    * 方法介绍:   设备明细查看
    * 参数说明:   No such property: code for class: Script1
    * @return     com.xoa.util.lims.LimsJson
    */
    @ResponseBody
    @RequestMapping("findInvenByDetailId")
    public  LimsJson findInvenByDetailId(HttpServletRequest request,Integer detailId){
        return equipmentInventoryService.findInvenByDetailId(request,detailId);
    }

    /**
    * 创建作者:   庞君
    * 创建日期:   13:29 2019/10/22
    * 方法介绍:   删除设备盘点信息
    * 参数说明:   No such property: code for class: Script1
    * @return     com.xoa.util.lims.LimsJson
    */
    @RequestMapping("delInveInfo")
    @ResponseBody
    public LimsJson delInveInfo(HttpServletRequest request,String ids){
        return equipmentInventoryService.delInveInfo(request,ids);
    }

    /**
    * 创建作者:   庞君
    * 创建日期:   14:22 2019/10/22
    * 方法介绍:   盘点编辑数据回显
    * 参数说明:   No such property: code for class: Script1
    * @return     com.xoa.util.lims.LimsJson
    */
    @ResponseBody
    @RequestMapping("showEditInfo")
    public LimsJson showEditInfo(HttpServletRequest request,Integer inveId){
        return equipmentInventoryService.showEditInfo(request,inveId);
    }
    /**
    * 创建作者:   庞君
    * 创建日期:   14:44 2019/10/22
    * 方法介绍:   编辑盘点信息
    * 参数说明:   No such property: code for class: Script1
    * @return     com.xoa.util.lims.LimsJson
    */
    @RequestMapping("editInveInfo")
    @ResponseBody
    public LimsJson editInveInfo(String  limsEquipInvePlan , String  limsEquipInveCont){
        return equipmentInventoryService.editInveInfo(limsEquipInvePlan,limsEquipInveCont);
    }

    /**
    * 创建作者:   庞君
    * 创建日期:   13:18 2019/10/23
    * 方法介绍:   盘点状态修改
    * 参数说明:   No such property: code for class: Script1
    * @return     com.xoa.util.lims.LimsJson
    */
    @RequestMapping("upInveStatus")
    @ResponseBody
    public LimsJson upInveStatus(String planStatus, Integer planId,String limsEquipInventory){
        return equipmentInventoryService.upInveStatus(planStatus,planId,limsEquipInventory);
    }

    /**
    * 创建作者:   庞君
    * 创建日期:   13:20 2019/10/23
    * 方法介绍:   盘点数据回显
    * 参数说明:   No such property: code for class: Script1
    * @return     com.xoa.util.lims.LimsJson
    */
    @ResponseBody
    @RequestMapping("inveShowInfo")
    public LimsJson inveShowInfo(Integer inveId,Integer detailId){
        return equipmentInventoryService.inveShowInfo(inveId,detailId);
    }
    /**
    * 创建作者:   庞君
    * 创建日期:   13:21 2019/10/23
    * 方法介绍:   设备同步
    * 参数说明:   No such property: code for class: Script1
    * @return     com.xoa.util.lims.LimsJson
    */
    @RequestMapping("syncEquip")
    @ResponseBody
    public  LimsJson syncEquip(String equipLists){
        return equipmentInventoryService.syncEquip(equipLists);
    }
    /**
    * 创建作者:   庞君
    * 创建日期:   14:04 2019/10/23
    * 方法介绍:   复制盘点计划
    * 参数说明:   No such property: code for class: Script1
    * @return     com.xoa.util.lims.LimsJson
    */
    @RequestMapping("copyInvenPlan")
    @ResponseBody
   public LimsJson copyInvenPlan(LimsEquipInvePlan limsEquipInvePlan){
        return equipmentInventoryService.copyInvenPlan(limsEquipInvePlan);
   }

}
